#include <limits.h>

void func(signed int si_a,signed int si_b){
    signed int diff;
    if ((si_b > 0 && si_a < INT_MIN + si_b) || (si_b < 0 && si_a > INT_MAX + si_b)){
        /* Handle error */
    } else {
        diff = si_a - si_b;
    }
    /* ... */
}